<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>联系我们 - Ubike自行车外贸公司联系方式 | 商务合作</title>
    <meta name="description" content="联系Ubike专业自行车外贸公司。获取产品报价、商务合作、技术支持等服务。邮箱：h3444850160@gmail.com，专业团队为您服务。">
    <meta name="keywords" content="Ubike联系方式,自行车外贸合作,产品报价,商务合作,技术支持">
    <meta name="robots" content="index, follow">
    <link rel="canonical" href="https://ubike.com/contact">
    
    <!-- Open Graph Meta Tags -->
    <meta property="og:title" content="联系我们 - Ubike自行车外贸公司">
    <meta property="og:description" content="专业自行车外贸公司联系方式及商务合作">
    <meta property="og:type" content="website">
    <meta property="og:url" content="https://ubike.com/contact">
    <meta property="og:image" content="/static/tp/Logo.png">
    
    <!-- Schema.org Markup -->
    <script type="application/ld+json">
    {
        "@context": "https://schema.org",
        "@type": "ContactPage",
        "name": "联系我们",
        "description": "Ubike自行车外贸公司联系方式",
        "url": "https://ubike.com/contact",
        "contactPoint": {
            "@type": "ContactPoint",
            "email": "h3444850160@gmail.com",
            "contactType": "customer service",
            "availableLanguage": ["Chinese", "English"]
        }
    }
    </script>
    
    <link rel="stylesheet" href="/static/css/style.css">
    <link href="https://cdn.bootcdn.net/ajax/libs/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
</head>
<body>
    <!-- 头部区域 -->
    <header class="header">
        <div class="wrap">
            <!-- 导航菜单 -->
            <nav class="main-nav">
                <div class="nav-container">
                    <div class="logo">
                        <a href="/">
                            <img src="/static/tp/Logo.png" alt="ubike">
                        </a>
                    </div>
                    <ul class="nav-menu">
                        <li><a href="/">首页</a></li>
                        <li><a href="/about">关于我们</a></li>
                        <li>
                            <a href="#" onclick="alert('特色服务页面正在开发中...')">特色服务 <i class="fas fa-chevron-down"></i></a>
                            <ul class="dropdown">
                                <li><a href="#" onclick="alert('产品定制页面正在开发中...')">产品定制</a></li>
                                <li><a href="#" onclick="alert('物流配送页面正在开发中...')">物流配送</a></li>
                            </ul>
                        </li>
                        <li>
                            <a href="/products">产品图集</a>
                        </li>
                        <li>
                            <a href="/blog">行业资讯</a>
                        </li>
                        <li class="active">
                            <a href="/contact">联系我们</a>
                        </li>
                    </ul>
                    <div class="nav-right">
                        <!-- 语言切换器 -->
                        <user-language-switcher></user-language-switcher>
                        
                        <div class="search-box">
                            <input type="text" placeholder="搜索...">
                            <button><i class="fas fa-search"></i></button>
                        </div>
                        <div class="contact-info">
                            <span class="email"><i class="fas fa-envelope"></i> h3444850160@gmail.com</span>
                        </div>
                    </div>
                </div>
            </nav>
        </div>
    </header>

    <!-- 页面标题 -->
    <section class="page-title">
        <div class="wrap">
            <h1>联系我们</h1>
            <p>期待您的惠顾</p>
        </div>
    </section>

    <!-- 联系内容 -->
    <section class="contact-section">
        <div class="wrap">
            <div class="contact-info">
                <div class="contact-item">
                    <i class="fas fa-map-marker-alt"></i>
                    <h3>公司地址</h3>
                    <p>河北省邢台市桥东区中兴东大街168号</p>
                    <p style="font-size: 12px; color: #666; margin-top: 5px;">（ubike总部大楼）</p>
                </div>
                <div class="contact-item">
                    <i class="fas fa-phone"></i>
                    <h3>联系电话</h3>
                    <p>400-888-8888</p>
                    <p style="font-size: 12px; color: #666; margin-top: 5px;">（客服热线）</p>
                </div>
                <div class="contact-item">
                    <i class="fas fa-envelope"></i>
                    <h3>邮箱</h3>
                    <p>h3444850160@gmail.com</p>
                    <p style="font-size: 12px; color: #666; margin-top: 5px;">（商务合作）</p>
                </div>
                <div class="contact-item">
                    <i class="fas fa-clock"></i>
                    <h3>营业时间</h3>
                    <p>周一至周五：9:00-18:00</p>
                    <p style="font-size: 12px; color: #666; margin-top: 5px;">（节假日除外）</p>
                </div>
            </div>

            <div class="contact-form-section">
                <h2>给我们留言</h2>
                <p style="margin-bottom: 20px; color: #666;">如果您对我们的博客内容感兴趣，欢迎订阅我们的最新资讯</p>
                
                <!-- 博客订阅快速入口 -->
                <div class="blog-subscription-quick" style="background: #f8f9fa; padding: 20px; border-radius: 8px; margin-bottom: 30px;">
                    <h3 style="margin: 0 0 15px 0; color: #333;">📰 博客订阅</h3>
                    <p style="margin: 0 0 15px 0; color: #666;">订阅我们的博客，获取最新的骑行资讯、产品评测和保养技巧</p>
                    <button type="button" class="quick-subscribe-btn" onclick="showBlogSubscription()" style="background: #1e88e5; color: white; border: none; padding: 10px 20px; border-radius: 6px; cursor: pointer; font-weight: 500;">
                        <i class="fas fa-rss"></i> 快速订阅博客
                    </button>
                </div>
                
                <form class="contact-form" id="contactForm">
                    <div class="form-group">
                        <label for="name">姓名 *</label>
                        <input type="text" id="name" name="name" required>
                    </div>
                    <div class="form-group">
                        <label for="email">邮箱 *</label>
                        <input type="email" id="email" name="email" required>
                    </div>
                    <div class="form-group">
                        <label for="phone">电话</label>
                        <input type="tel" id="phone" name="phone">
                    </div>
                    <div class="form-group">
                        <label for="subject">主题</label>
                        <select id="subject" name="subject">
                            <option value="">请选择主题</option>
                            <option value="blog-subscription">博客订阅</option>
                            <option value="product">产品咨询</option>
                            <option value="service">服务咨询</option>
                            <option value="after-sales">售后服务</option>
                            <option value="feedback">意见反馈</option>
                            <option value="other">其他咨询</option>
                        </select>
                    </div>
                    <div class="form-group">
                        <label for="message">留言内容 *</label>
                        <textarea id="message" name="message" rows="5" required placeholder="请告诉我们您感兴趣的博客内容类型，如：骑行技巧、产品评测、保养知识等"></textarea>
                    </div>
                    <div class="form-group" style="display: none;" id="blogSubscriptionFields">
                        <label>订阅偏好</label>
                        <div style="display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px;">
                            <label style="display: flex; align-items: center; cursor: pointer;">
                                <input type="checkbox" name="blog_categories" value="riding_tips" style="margin-right: 5px;"> 骑行技巧
                            </label>
                            <label style="display: flex; align-items: center; cursor: pointer;">
                                <input type="checkbox" name="blog_categories" value="product_reviews" style="margin-right: 5px;"> 产品评测
                            </label>
                            <label style="display: flex; align-items: center; cursor: pointer;">
                                <input type="checkbox" name="blog_categories" value="maintenance" style="margin-right: 5px;"> 保养知识
                            </label>
                            <label style="display: flex; align-items: center; cursor: pointer;">
                                <input type="checkbox" name="blog_categories" value="industry_news" style="margin-right: 5px;"> 行业资讯
                            </label>
                        </div>
                    </div>
                    <button type="submit" class="submit-btn">发送留言</button>
                </form>
            </div>
        </div>
    </section>

    <!-- 博客订阅模态框 -->
    <div id="blogSubscriptionModal" class="modal" style="display: none;">
        <div class="modal-content" style="max-width: 500px;">
            <div class="modal-header">
                <h3>博客订阅</h3>
                <span class="close" onclick="closeBlogSubscriptionModal()">&times;</span>
            </div>
            <div class="modal-body">
                <form id="blogSubscriptionForm">
                    <div class="form-group">
                        <label for="sub_name">姓名 *</label>
                        <input type="text" id="sub_name" name="name" required>
                    </div>
                    <div class="form-group">
                        <label for="sub_email">邮箱 *</label>
                        <input type="email" id="sub_email" name="email" required>
                    </div>
                    <div class="form-group">
                        <label for="sub_phone">电话</label>
                        <input type="tel" id="sub_phone" name="phone">
                    </div>
                    <div class="form-group">
                        <label>订阅偏好 *</label>
                        <div style="display: flex; flex-direction: column; gap: 10px; margin-top: 10px;">
                            <label style="display: flex; align-items: center; cursor: pointer;">
                                <input type="checkbox" name="categories" value="riding_tips" style="margin-right: 5px;"> 骑行技巧
                            </label>
                            <label style="display: flex; align-items: center; cursor: pointer;">
                                <input type="checkbox" name="categories" value="product_reviews" style="margin-right: 5px;"> 产品评测
                            </label>
                            <label style="display: flex; align-items: center; cursor: pointer;">
                                <input type="checkbox" name="categories" value="maintenance" style="margin-right: 5px;"> 保养知识
                            </label>
                            <label style="display: flex; align-items: center; cursor: pointer;">
                                <input type="checkbox" name="categories" value="industry_news" style="margin-right: 5px;"> 行业资讯
                            </label>
                        </div>
                    </div>
                    <div class="form-group">
                        <label for="sub_message">其他需求</label>
                        <textarea id="sub_message" name="message" rows="3" placeholder="请告诉我们您特别感兴趣的博客内容"></textarea>
                    </div>
                    <button type="submit" class="submit-btn">确认订阅</button>
                </form>
            </div>
        </div>
    </div>

    <script>
        // 显示博客订阅模态框
        function showBlogSubscription() {
            const modal = document.getElementById('blogSubscriptionModal');
            modal.style.display = 'block';
        }

        // 关闭博客订阅模态框
        function closeBlogSubscriptionModal() {
            const modal = document.getElementById('blogSubscriptionModal');
            modal.style.display = 'none';
        }

        // 处理博客订阅表单提交
        document.getElementById('blogSubscriptionForm').addEventListener('submit', async function(e) {
            e.preventDefault();
            
            const formData = new FormData(this);
            const data = {
                name: formData.get('name'),
                email: formData.get('email'),
                phone: formData.get('phone'),
                subject: '博客订阅',
                message: formData.get('message') || '订阅博客资讯',
                subscription_type: 'blog',
                blog_categories: Array.from(formData.getAll('categories'))
            };

            try {
                const response = await fetch('/api/subscribe', {
                    method: 'POST',
                    headers: {
                        'Content-Type': 'application/json'
                    },
                    body: JSON.stringify(data)
                });

                const result = await response.json();

                if (result.success) {
                    alert('订阅成功！我们会尽快与您联系。');
                    closeBlogSubscriptionModal();
                    this.reset();
                } else {
                    alert('订阅失败：' + result.message);
                }
            } catch (error) {
                console.error('订阅请求失败:', error);
                alert('订阅失败，请稍后重试');
            }
        });

        // 处理联系我们表单提交
        document.getElementById('contactForm').addEventListener('submit', async function(e) {
            e.preventDefault();
            
            const formData = new FormData(this);
            const data = {
                name: formData.get('name'),
                email: formData.get('email'),
                phone: formData.get('phone'),
                subject: formData.get('subject'),
                message: formData.get('message'),
                subscription_type: formData.get('subject') === 'blog-subscription' ? 'blog' : 'contact',
                blog_categories: formData.get('subject') === 'blog-subscription' ? 
                    Array.from(formData.getAll('blog_categories')) : []
            };

            try {
                const response = await fetch('/api/subscribe', {
                    method: 'POST',
                    headers: {
                        'Content-Type': 'application/json'
                    },
                    body: JSON.stringify(data)
                });

                const result = await response.json();

                if (result.success) {
                    alert('留言发送成功！我们会尽快与您联系。');
                    this.reset();
                } else {
                    alert('留言发送失败：' + result.message);
                }
            } catch (error) {
                console.error('留言请求失败:', error);
                alert('留言发送失败，请稍后重试');
            }
        });

        // 根据主题选择显示/隐藏博客订阅字段
        document.getElementById('subject').addEventListener('change', function() {
            const blogFields = document.getElementById('blogSubscriptionFields');
            if (this.value === 'blog-subscription') {
                blogFields.style.display = 'block';
            } else {
                blogFields.style.display = 'none';
            }
        });

        // 点击模态框外部关闭
        window.addEventListener('click', function(e) {
            const modal = document.getElementById('blogSubscriptionModal');
            if (e.target === modal) {
                closeBlogSubscriptionModal();
            }
        });
    </script>

    <!-- 页脚 -->
    <footer class="footer">
        <div class="wrap">
            <div class="footer-content">
                <div class="footer-section">
                    <h3>关于我们</h3>
                    <p>ubike致力于为您提供最优质的骑行装备和贴心服务。</p>
                    <div class="social-links">
                        <a href="#"><i class="fab fa-weixin"></i></a>
                        <a href="#"><i class="fab fa-weibo"></i></a>
                        <a href="#"><i class="fab fa-instagram"></i></a>
                    </div>
                </div>
                <div class="footer-section">
                    <h3>营业时间</h3>
                    <p>7x24小时营业</p>
                </div>
                <div class="footer-section">
                    <h3>联系我们</h3>
                    <p>邮箱:h3444850160@gmail.com</p>
                    <p>地址: 河北邢台</p>
                </div>
            </div>
            <div class="footer-bottom">
                <p>© 2025 ubike. 保留所有权利.</p>
            </div>
        </div>
    </footer>

    <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
    <script src="/static/js/script.js"></script>
    
    <!-- 语言切换组件 -->
    <script src="/static/js/language-switcher.js"></script>
</body>
</html>